home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14092 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: newdelph.cig.mot.com!usenet
  2. From: Martin O'Hara <oharam>
  3. Newsgroups: comp.lang.c++
  4. Subject: (no subject)
  5. Date: 28 Mar 1996 14:49:19 GMT
  6. Organization: Motorola Cellular Infrastructure Group
  7. Message-ID: <4je8tf$2tc@newdelph.cig.mot.com>
  8. NNTP-Posting-Host: liath202.cork.cig.mot.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.1 (X11; I; SunOS 4.1.3_U1 sun4m)
  13. X-URL: news:comp.lang.c++/123179-123279
  14.  
  15. Hi there,
  16.  
  17. I posted an article in or around 8-9 March with a couple of C++ questions but
  18. Ive been away in the mean time and so didnt get a chance to check for replies
  19. on this group. So once again if anyone has the definintive answers to the
  20. questions below please mail me at oharam@cork.cig.mot.com
  21.  
  22. Outlined inlines :
  23.    
  24. A : If the programmer declares a function to be inline but the compiler decides
  25. that it cant be made inline ( recursive function, function too big, address of
  26. function taken in code) what happens?
  27.  
  28.  
  29. B : Will the compiler generate inline calls for such a function wherever
  30. possible and generate an "outlined inline" in each translation unit where
  31. inlining isnt possible. In other words can both an inlined version of a
  32. function and an outlined version( callable function local to translation unit)
  33. be present in a program.
  34.  
  35. For example if we have
  36.  
  37. inline int f()
  38. {
  39.    return x;
  40. }
  41.  
  42. Say this is called in A.C - It can be inlined here
  43. However if B.C contains code which takes the address of f() then a callable
  44. function must be generated??
  45.  
  46.  
  47. VTAB Replication:
  48.  
  49. Most smart compilers use a heuristic for deciding where to put the VTAB which
  50. is
  51. in the file where the first non inline virtual function of a class is defined
  52. Is the VTAB for a class having no non inline virtual functions( ie all virtual
  53. functions are inline ones) replicated in each translation unit in which the
  54. header for that class is included? Does this happen in any other cases??
  55.  
  56. Cheers 
  57.  
  58. /Martin
  59.  
  60.